package cn.iocoder.springboot.lab15.java_api_client.service.impl;

import cn.iocoder.springboot.lab15.java_api_client.dataobject.User;
import cn.iocoder.springboot.lab15.java_api_client.repository.UserRepository;
import cn.iocoder.springboot.lab15.java_api_client.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class UserServiceImpl implements UserService {
    @Autowired
    private UserRepository userRepository;

    @Override
    public User save(User user) {
        return userRepository.save(user);
    }

    @Override
    public void delete(User user) {
        userRepository.delete(user);
    }

    @Override
    public Iterable<User> getAll() {
        return userRepository.findAll();
    }

}
